perm filename SIX12.DOC[UP,DOC] blob sn#472481 filedate 1979-09-12 generic text, type T, neo UTF8








                              SIX12 USER'S MANUAL



                                R. K. Johnsson
                                C. B. Weinstock
                                  Wm. A. Wulf
                                    T. Lane
                                J. M. Newcomer
                                             *
                                R. F. Brender





                               4 September 1979


                               BLISS-10/BLISS-36
                              Compatible version

                                 TOPS10/TOPS20
                              Compatible version


  *
   Digital Equipment Corporation, Maynard, Mass.













This  research  was  sponsored by the Defense Advanced Research Projects Agency
(DOD), ARPA Order No. 3597, monitored by  the  Air  Force  Avionics  Laboratory
Under Contract F33615-78-C-1551.

  The views and conclusions contained in this document are those of the authors
and  should  not  be  interpreted as representing the official policies, either
expressed or implied, of the Defense Advanced Research Projects Agency  or  the
US Government.
                                                                              1

1. Introduction
  This  document  is  intended  as  a  from-scratch  introduction  to SIX12, an
extensive debugging aid for Bliss programs on the PDP-10.  It  applies  to  the
version  of August 1979.  There is a shorter write-up, suitable for at-terminal
reference, as SIX12.HLP.

1.1. The August 1979 Version
  The August 1979 version of SIX12 is substantially enhanced.  Users of earlier
versions will notice some incompatibilities with  earlier  versions  of  SIX12.
The most significant changes at the user level are

   - The  "left-arrow"  operator, or underline, no longer is an assignment
     operator.  It is now  a  valid  character  for  use  in  identifiers.
     Assignment, as in Bliss-10 and Bliss-36, uses the equal sign.

   - The way in which SIX12 is called from DDT; see the section on getting
     into  SIX12,  page  16.    Also, SIX12 now is entered implicitly upon
     starting the program, and the user must change this default by either
     patching the start-flag with DDT or by using the linker to change the
     initial value.

  Most of the changes  are  the  work  of  Ron  Brender  of  Digital  Equipment
Corporation.    These include the changes for Bliss-36 support and TOPS-20 I/O,
the multiple configurations which produce the several versions of SIX12 for the
cross-product of Bliss-10 and Bliss36 support for TOPS-10 and TOPS-20 operating
systems, cleaned up  display  formatting,  enhanced  displays  of  status,  the
ability to name actual parameters and local variables.

  Joe  Newcomer  added  the single-step support, polling override, STORE/RECALL
facility, and made Steve Hobbs' LG support for the CMU symbolic I/O package  LG
included  under  a conditional switch (thus integrating our SIXLG with standard
SIX12).

  Other people have made other changes, and for the list of current changes and
the credits, examine the change log in the first page of SIX12.BLI.

1.2. SIX12 overview
  SIX12 is a specialized debugger adapted to the Bliss environment.  It is  not
intended  as  a  substitute for DDT; the user is expected to load both with his
program and use whichever is more convenient to the need of the moment.   Under
this  assumption  there  has  been  no  attempt  to duplicate functions already
well-performed by DDT, namely

   - breakpointing and tracing at the instruction level,

   - symbolic typeout and typein in any mode required (at last  count  DDT
     could display or accept values in over a dozen different modes).

  SIX12 is oriented to the Bliss programming environment in two ways:

   - It  conforms to Bliss philosophy and notation. A debugging command is
     syntactically an expression, which is read  in,  evaluated,  and  the
2

     value  (if any) printed.  However, much modification has been made to
     the Bliss syntax in the interests of flexibility.  In particular,  an
     expression  is  not required always to yield a fullword value. It may
     yield no value, or a vector value of several words. Also  the  syntax
     accepted   for   operators  has  been  expanded  to  include  nullary
     operators, which have no operands, and postfix operators which follow
     their operand.  For example,

     A AND 7         uses the infix operator "AND"

     .A              uses the prefix operator "."

     GO              uses the nullary operator "GO"

     137/            uses the postfix operator "/"

     BREAK R1,ERROR,PRINT
                     uses the prefix operator  "BREAK",  which  accepts  a
                     vector operand.  A higher-priority infix operator ","
                     is used to form the vector from elementary operands.

     (As  demonstrated in the last example, with this syntax we can get by
     without any keyword forms (for declarations etc.) at  all.  To  SIX12
     everything  is  an  operator  or  operand. The user will find it more
     convenient, of course, to visualize commands formatted in this way as
     keyword plus list of arguments.)

   - SIX12 is  routine-oriented.  By  this  we  mean  that  breakpointing,
     tracing, and similar functions dealing with flow-of-control all occur
     at  the abstract routine level, rather than at the individual machine
     instruction level (as in DDT).  In still another  way:  the  smallest
     unit  of  code  that  SIX12  can  see  is  a  routine  (or FUNCTION).
     Breakpoints must always be set at either  the  entry  or  exit  of  a
     routine, and tracing of execution is always in terms of routine calls
     and  returns.  DDT  is  used  when  code must be dealt with below the
     routine level.

1.3. Advantages of SIX12 over DDT

   - Source language debugging - SIX12 accepts  Bliss-like  notation,  and
     does  tracing and breaking in a form easily relatable to the original
     source program.

   - Facilities that DDT simply does not have, for instance

        * the ability to monitor  data  (not  instruction)  locations  and
          report when they are modified,

        * the  ability  to interrupt the program on console input.  If any
          character is typed while the program is  executing  (i.e.,  when
          not  in  TTY  input wait), SIX12 will intercept control and wait
          for completion of the debug command.
                                                                              3

   - Extendability.  SIX12  permits  easy  definition of new operators; in
     addition simple macros can be defined and used in expressions.

   - SIX12 can be used to debug in shared high-segments.  DDT  breakpoints
     cannot  be  used  in  shared  code,  but  the  SIX12 linkage has been
     designed so that two or more people can  be  debugging  the  same  or
     different  routines,  and  still  others  running  without  using the
     debugger, all in the same high-segment without interference.

1.4. Disadvantages of SIX12

   - No access to program at machine code level.

   - Limited variety of modes for symbolic typeout or typein of values.

   - Speed, or rather lack of it. SIX12 requires some computation at every
     routine call or return, while DDT requires time only  at  breakpoints
     (and less time at that).
                       1
         SIX12 overhead

                                                                              2
         Situation                                                Instructions
         Simple conditional, condition satisfied                           8600
         Simple conditional, condition unsatisfied                         2500
         No conditional                                                    6500
                       3
         No actions set                                                      17
                                 4
         No action set on routine                                           107

   - Space  required.  SIX12 uses about 15P (7.5K) in the high segment and
     7P (3.5K) in the low segment (in the standard version),  besides  the
     2K low-segment space for DDT, and the program-dependent low-seg space
     for the symbol table (which, however, is required even for DDT).

  Note:  The  first  two of these are alleviated by the ease with which one can
pass from SIX12 to DDT and back. Thus the full  facilities  of  DDT  are  still

---------------
  1
   Measured from instruction traces of SIX12 V.6.26, August, 1979.
  2
   Before  returning  control  to  the  program or asking the user for
input, depending upon the action to be taken.
  3
   No actions of any kind on any routine.
  4
   Other actions may be set on other routines
4

available to the SIX12 user.
                                                                              5

2. SIX12 expressions
  At  the lexical level, SIX12 treats lower case and upper case identically, so
commands may be typed in either case or a mixture of both.  In addition,  SIX12
will  recognize any unique abbreviation (two characters minimum) for any of its
alphabetic operators.  Thus, all of the lines below say the same thing:

    IF |.A LSS .B| BREAK FOO,BAZ
    if |.a lss .b| break foo,baz
    if |.a ls .b| BREAK foo,baz
    if |.a ls .b| br foo,baz

  SIX12 contains a  fairly  intelligent  syntax  analyzer/evaluator  which  can
evaluate  quite  complex  expressions.  For  instance, all of the following are
legal Bliss expressions; they are also legal in SIX12  and  would  produce  the
same result.

            .ALPHA
            SUM = .SUM + 3
            NOT .FLAGS<1,1>
            MYROUTINE (7, .B, XYZ())

The  syntax analyzer recognizes two classes of objects: operators and operands.
The meaning of operators is not built into the analyzer, but is  defined  by  a
table of routines which are to be called to evaluate them. This makes it simple
to  add new operators or redefine old ones; this can even be done at runtime if
the necessary routines were compiled and loaded  separately  from  SIX12.  (The
methods  for  defining  your  own  operators  are  discussed  later;  we assume
everywhere in  this  paper  that  you  have  not  tampered  with  any  standard
operators.)   The meaning of operands, however, is built into the analyzer. The
possible types of operand are

            <number>        <string>        <symbol>

  A number is a sequence of digits, possibly preceded by a number  sign  #. Its
value  is the equivalent binary integer. The number is assumed to be written in
the default radix or base, which can be set or examined by one of the  standard
operators  (BASE,  see page 28). The escape character # is provided to ease the
use of two radices: a number preceded by # is taken  to  be  written  in  octal
radix  regardless  of  the default radix, unless the default radix is octal, in
which case the number is taken as decimal. For example,


     default radix              input       value (octal)
    10 (decimal)                   34       000042
    10                            #34       000034
     2 (binary)                 10110       000026
     2                            #34       000034
     8 (octal)                     34       000034
     8                            #34       000042

Thus when the default base is decimal, this is the same  as  the  Bliss  source
convention. When SIX12 is initialized, the default base is octal (as with DDT).
6

  Strings are inputted as

            'string'        or      "string"

corresponding  to  left-  and  right-adjusted  ASCII  strings respectively.  In
either type of string the other string delimiter can appear freely, and  double
occurrences of the string delimiting character are used to denote it once. This
is  precisely  the  same  as the Bliss convention.  However, note the following
differences:

   - ? is not implemented as an escape character;

   - Carriage return cannot appear in a string; it terminates  the  string
     just  as  if  the  matching  delimiter had been encountered (CR or LF
     always terminate debug input expressions);

   - RADIX50,  ASCIZ  and  SIXBIT  stringtype  converters  have  not  been
     implemented.  They  could  be easily included by defining appropriate
     operators.

Examples:

            'HI!'   "Q"     'a CR or LF terminates me anyway

  A long-string, as in the last example, generates a vector value.

  Symbols are the most complex type of operand.  A symbol is looked up  in  the
Loader-generated symbol table, and its value is the value entered for it in the
table.  Thus a name is an address, as in Bliss.  (We get around the fact that a
name should be a byte pointer by  some  monkeying  with  the  definition  of  .
(contents)  and = (store).  The gory details come later on.)  DDT has a complex
search convention to deal with the problem of multiply defined  symbols  (which
exists  because  the  table only contains six characters of a name). SIX12 uses
this much simpler rule: identical symbols are implicitly numbered in the  order
in  which  they  were  loaded.  If there are more than one symbol with the same
name, the name must be suffixed by  %n,  where  n  is  the  ordinal  you  want.
Examples:

                    HELP            Value of the symbol 'HELP  '
                    LOTSOFME%5      value of fifth symbol   'LOTSOF'
                    LOTSOFME        Error - ambiguous

There  are  symbol table searchers included in the standard set of operators to
help you decide which ordinal you want, or remember what name you need  in  the
first place. See Display, chapter 12.  Note: since names (letter-digit strings)
can  also  refer  to  operators (e.g., AND OR) the % convention is also used to
distinguish symbols from operators. An unadorned name is first searched for  in
the table of operators, then in the symbol table, taking the first match in the
process. However, name%n is only searched for in the symbol table.  Thus 'OR%1'
always  gets  you the symbol OR but 'OR' is taken for the operator OR.  Further
note: The only source of program symbols that SIX12 has is  the  Loader  symbol
table (also used by DDT). Therefore, locals, formals, structures, and so on are
                                                                              7

unknown  to SIX12. Only globals, owns, routines (or functions) and module names
will be present in the table.  We have now fully discussed operands,  and  turn
to  the  operators  which work upon them. Operators are denoted either by names
(e.g., GEQ, BREAK) or by special characters  (e.g.,  %  +  ↑).  In  the  latter
category,  '  " # % space tab CR LF may not name operators. The syntax analyzer
distinguishes four syntactic types of operators, namely

    Nullary, having no operands:               <operator>
    Prefix, preceding its operand:             <operator>  <operand>
    Postfix, following its operand: <operand>  <operator>
    Infix, having both operands:    <operand>  <operator>  <operand>

The same symbol may represent more than one operator in different  parses.  For
example

                            + E
                            E + F

show  "+"  in prefix and infix parses; these two instances will actually result
in the invocation of two different routines to evaluate "+".    In  theory  the
same symbol could be given all four parses, invoking 1 to 4 different routines;
in  practice  this  is  a  poor  idea.  An  operator with more than 1 parse can
introduce ambiguity: the classic case  is  with  "/",  which  in  the  standard
definition  has  postfix (A/ prints contents of A, as DDT would) and infix (A/B
does division) parses. Now, does

                    A/-N

invoke postfix "/" followed by infix "-", or prefix "-" followed by infix  "/"?
With  the definitions given above the second is clearly the correct choice, but
the analyzer can hardly be expected to know that. In point of fact this will be
evaluated in the first way, due solely to an arbitrary design  decision.    The
moral  of  this  story is that the analyzer cannot be expected to always do the
right thing.  It works fine for pure Bliss expressions; a key thing  is  to  be
wary  of  using  expressions  which  yield  a null value (as x/ does) in larger
expressions. The analyzer assumes that operators will yield a value,  and  gets
confused when they don't (since its assumptions about the parsing of subsequent
operators must be junked).  If an expression with side-effects blows up, always
check to see how much of it had already been evaluated.  Two good rules to keep
out  of  trouble  are  1)  parentheses  can  fix  lots  of things, and 2) avoid
semicolons - you can afford to do it on two lines.

  With these words of warning we pass to a description of the standard  set  of
operators.  This is the meat of what you can do with SIX12.
8

3. Basic Bliss
  We  do  not  pretend to have implemented a Bliss interpreter. However, a fair
subset of the simple expressions (*not* control expressions) is available,  and
more  could  be implemented if you need it. The following operators are defined
exactly as in Bliss:

            + -             for example  -E1  or E2+E3
            * /             as  A*B  (beware of E/ , which is not
                            an error)
                                            5
            ↑               as  A↑B  (shift)
            AND NOT OR      logicals
            GEQ thru LSS    the relationals

  Parentheses ( ) also behave as in Bliss: as grouping indicators

    (arbitraryexpression)

or as routine callers

    R(elist)

For instance

                    5*(.ALPHA-1)
                    MYROUTN(41, .PARM)

The value of the second expression is the value returned by calling the routine
MYROUTN with two actuals.

  Angle  brackets   < > have   the   same   meaning,   of   creating   a   byte
pointer. However,  index  and  indirect  fields are not accepted; there must be
exactly two values within the brackets, i.e.

            addr<pos,size>

is the only allowable syntax for them.

  Dot . performs the same function, 'contents', and equals = the same function,
'store', as in Bliss. For instance

---------------
  5
   In Bliss-10, ↑ is a logical shift.  In Bliss-36, ↑ is  a  logical  shift
left  and  an  arithmetic  shift  right.  SIX12 does the appropriate shift,
depending upon whether it is compiled with Bliss-10  linkages  or  Bliss-36
linkages.
                                                                              9

                    .A1
                    .FLAG<17,1>
                    SE = .SE * 200
                    FOO = .A1 + 23

You  should  be  aware,  however,  of this difference. SIX12 evaluates names as
addresses, not byte pointers, so that the  left  half  of  a  name's  value  is
normally  zero.  The  motive for this is that we can then display the addresses

corresponding to program names  without  trashing  things  up  with  a  nonzero
         6
left-half .  (Also, we can't assume that every value in the symbol table should
be converted to a fullword pointer.)  In order that both
            .A  and  .A<3,3>
    or
            A=0  and  A<0,18>=0

will  work  properly,  the  semantics of dot and equals have been modified from
Bliss-10 semantics (and in fact, are closer to Bliss-36  semantics).    If  the
left  half  of a pointer word is zero, it is treated as a fullword pointer, but
words with nonzero left halves are taken as true  byte  pointers.    (The  same
applies  to  the MONITOR operation, which may be given either word addresses or
byte pointers).  The only way this will be  noticeable  to  the  user  is  that
sometimes . will act like @, and = will do a store where nothing should happen.
In  Bliss-10, .41 will yield zero every time (being equivalent to .41<0,0>) but
in Bliss-36 or SIX12 it will yield the contents of word  41  (corresponding  to
@41  in  Bliss-10).  Similarly  for  41  = E. Also, A = B should be written A =
B<0,36> .

  Atsign @ does exactly the same thing as Bliss (the above doesn't apply).

3.1. Structure accesses
  Brackets [ ] with a single parameter do a structure access according  to  the
standard VECTOR structure.  Hence E1[E2] is equivalent to (E1+E2)<0,36>.

  Brackets with three or four parameters do a structure access according to the
standard Bliss-36 BLOCK structure.

  In  addition, if the user sets the symbol SIXREF the access will be done as a
REF-structure rather than a Structure access (the REF-structure is a feature of
Bliss-36, but the effects are the same when used with Bliss-10 SIX12).

  Perhaps someday we will get structure information from the compiler...

---------------
  6
   Would you rather see the value of  'XYVAR'  as  4322  or  4400004322  ?  The
situation is even worse if you're working in decimal, as then the halfwords are
not separable by eye.
10

3.2. Numbers, names and strings

number          A  number  is  a  sequence of digits interpreted in the current
                radix (initially base 8).  See page 5.

#number         A number preceded by a # changes to the "other" radix, i.e., if
                in base 8, the number is interpreted in base 10; if in base 10,
                it is interpreted in base 8.  See page 5.

number %A       Refers the the n'th actual parameter  of  the  current  routine
                (when stopped at routine entry or exit).

number %L       Refers to the n'th local word of the stack frame of the current
                routine.   Local words include any saved register values, stack
                management control words, etc. that may be allocated after  the
                frame  pointer.   Consequently, a machine code listing might be
                required to determine the actual correct  offset  for  a  local
                variable.

name            A  name  is  1  to  6 characters from the set "A"-"Z", "a"-"z",
                "0"-"9", "$", "&", "←".  The first  character  must  not  be  a
                digit.    Lower case letters are converted to uppercase, "&" is
                                                            7
                converted to "." and "←" is converted to "%"   Names are  typed
                out  using "." and "←" when Bliss-36 linkages are used, and "."
                and "%" are printed when Bliss-10 linkages are used.

                Names are looked up in one  of  three  symbol  tables  in  this
                order:    SIX12  macro table, SIX12 operator/command table, DDT
                symbol table.  The value of a name is  the  address  or  offset
                obtained  from  the  DDT symbol table (Module names are ignored
                during DDT symbol table lookup).
?name           ? allows the name which follows to include the  characters  "."
                and  "%",  so  the  transliterations  ("&" and "←") need not be
                used.  If %n is used after a name to disambiguate it,  a  space
                must separate the %n from the name.

name %n         Refers  to  the n'th entry in the DDT symbol table for the name
                (Module names are ignored and not counted).
       8
name %0         Refers to the SIX12 command or operator with the given name.

---------------
  7
   This conversion is used in the Bliss-36 compiler to  translate  "←"  into  a
character acceptable in RADIX50.
  8
   Zero
                                                                             11

4. Peeking and Poking
  One  basic  requirement  on  a  debugger is the ability to examine and modify
program locations.

  The only standard operator for changing memory locations is  assignment  (=),
which  should  need  no  explanation.  We should point out, however, that SIX12
never associates from right to left. Therefore,


                    A = B = C = 0

will not work in SIX12.    In  order  to  discourage  accidental  use  of  this
construct,  the  assignment  operator  is  defined  to  have no value... in the
example above, the address of B would be stored into A,  then  a  syntax  error
would occur since the second = would have no left operand.

  One  Bliss-compatible method for examination of program locations is provided
in the dot (.) and atsign (@) operators. As we mentioned in passing previously,
SIX12 prints out the result of every evaluated expression. Thus one  need  only
type  .ALPHA  to see the contents of ALPHA; for example, a terminal interaction
could look like this:

            &.FLAGS,.PNTR
                677  ==     677
               5737  ==     FFAREA+5

(Note: & is SIX12's prompt character).   A  DDT-type  notation  has  also  been
implemented.  The  operator  "/",  used  in  a  postfix fashion, prints out the
contents of the fullword whose address is its argument:

            &STACKCNT/
            STACKC/   566005322  == 566,,SPACE+203

The infix operator "!" does the same thing for a consecutive set of words;  A!N
prints N words beginning at A. For example:

            &BUFF!3
            BUFF/            57  == 57
            BUFF+1/         122  == 122
            BUFF+2/           0  == 0

Note:  In  all  cases, values or contents are first printed numerically (in the
default radix), then in symbolic halfword format (like DDT $R $H;  offsets  are
in the default radix).
12

5. Breakpointing, Tracing
  The  other basic requirement for a debugger is the ability to trace execution
of a program and stop it ('break') where necessary. As we said  earlier,  SIX12
does  this  on  a  routine  level.  The  basic  terms are of setting (and later
clearing) actions on routines. Any of these actions may be  set  conditionally.
Conditions  are fully general because they are given as SIX12 expressions. When
required, the text given is evaluated; it must yield 1 in the low-order bit  of
its value for the action to be taken. (If the expression yields a vector value,
only  the  first  word  is  considered; a test which yields a null value always
fails.) For instance, simple conditions might be

                    .FLAGS<17,1>
    or              .CCOUNT  GTR  0

Note:  it  should  be  apparent  that  setting  a  conditional  action   on   a
frequently-called  routine  is  a  poor idea. For simple conditions such as the
examples, a  conditional  breakpoint  for  which  the  condition  is  satisfied
executes  about  8500  instructions  between  the  breakpoint  instruction  and
requesting input  from  the  user;  a  conditional  breakpoint  for  which  the
condition is not satisfied executes about 2500 instructions.  See also page 3.

  The standard syntax for setting unconditional actions is


            actionname  listofroutines
    e.g.,
            BREAK  R2,PRINT,ERR3

The syntax for setting conditional actions is

            IF  |text of condition test|  actionname  listofroutines
    e.g.,
            IF |.VALUE<10,1>| TRACE TESTIT

where  "|"  delimits  the  text  which  is saved for evaluation.  (The <escape>
character could also be used, but you can't backspace over it).  Two notes:  IF
is  a  noise  word  and  can  be  dropped.  Commas in a list of routines can be
replaced by spaces. NEVER drop commas surrounding anything but a simple operand
(number,symbol). Thus, in

            TRACE  T34, .PNTR, EXIT

the commas are necessary, but they aren't for

            TRACE  T34 EXIT METOO

The same applies to commas anywhere else in SIX12 (e.g., routine calls).

  The syntax for clearing actions is

            Dactionname  listofroutines
                                                                             13

i.e. same mnemonic with D prefixed, as

            DBREAK  ZURICH

This  clears  either  conditional  or  unconditional  action.   The actions and
conditions for them may be examined with the PRINT ACTION command; see page 26.

  Conditional and unconditional actions do not coexist. There  cannot  be  both
conditional  and  unconditional instances of a given action on a given routine,
nor can there be more than one condition governing a given action  on  a  given
routine. Thus, if a conditional or unconditional break is set on a routine, any
previously  set  break  of  any  type on the same routine is cleared, but other
actions, say trace, on that routine are unaffected.

  For actions which take place after a routine has executed, the value  of  the
routine may be tested.  Normally this is in the VREG, but from SIX12 it must be
accessed as the variable SIXVREG, e.g.,


    &if |.sixvreg eql 0| abreak getpointer

See also page 14.  The possible actions are:

BREAK list      Stop execution at routine entry, with the message


                    <=> At: routine from call-loc
                            Actuals: values

ABREAK list     Stop execution at routine exit, with the message

                    <=> After: routine  Value: value == symbolic

DABREAK list    Remove ABREAKs from the routines listed.

DBREAK list     Remove BREAKs from the routines listed.

TRACE list      Prints  a  message  when  routine  is  entered  or left without
                breaking. The messages look like this:

                    --> routine  from call-loc
                        Actuals: values
                    <-- routine  Value: value == symbolic

TRACE AFTER list
                Initiates trace mode when the routine is entered, so  that  all
                routine  calls  and  returns  are  traced  until the routine is
                exited. The original routine call and return  are  not  traced.
                (No, Virginia, it won't screw up if the routine is recursive!)

TRACE FROM list Equivalent  to TRACE plus TRACE AFTER; thus the routine and its
                subroutines are traced.
14

DTRACE list     Remove TRACEs from the routines listed.

DTRACE FROM list
                Remove TRACE FROMs from the routines listed.

DTRACE AFTER list
                Remove TRACE AFTERs from the routines listed.

OPAQUE list     This  lends  a  degree  of  abstraction to tracing.  Tracing is
                turned off when an OPAQUE routine is entered, and  remains  off
                until the matching exit. OPAQUE 'outranks' TRACE; thus, even if
                routines with TRACEs set on them are called within the scope of
                an OPAQUE, they are not traced.

OPAQUE AFTER list
                This  does  OPAQUE  except  that  the routine itself is traced.
                Since we know that no trace printout will be  required  between
                entry  and  exit, paper is conserved by not printing a separate
                tracing notice for exit:

                    --> routine from call-loc
                        Actuals: values   Value: value == symbolic

                (assuming of course that tracing was on when  the  routine  was
                entered).

DOPAQUE list    Remove OPAQUEs from the routines listed.

DOPAQUE AFTER list
                Remove OPAQUE AFTERs from the routines listed.

COPAQUE         This command sets an internal switch so that calls made on user
                routines  from  SIX12 will not be traced even if SETTRACE is in
                effect.  This  is  useful  when  the  user  has  debug-printout
                routines  which  are  called  from  SIX12,  or has user-defined
                operator routines which are called from SIX12.  If SETTRACE  is
                in effect, it is turned off for the duration of the call.

NOCOPAQUE       This  command  resets  the internal switch to its default value
                set at initialization, so that  calls  on  routines  made  from
                SIX12 will be traced if a SETTRACE is in effect.

  TRACE,  TRACE AFTER,  TRACE FROM,  OPAQUE  and OPAQUE AFTER control the trace
facility during program execution.  The user may turn  tracing  on  or  off  by
means  of  the  SETTRACE, CLRTRACE and GOTRACE operators, overriding OPAQUEs or
TRACEs.  (see Getting In and Out of SIX12, chapter 6).  (The TRACE  and  OPAQUE
operators  merely  set  or  reset  a  switch  controlling the printing of trace
output. The  user  can  set  or  clear  this  switch  before  resuming  program
execution.)

  Note:  Conditional  actions  set  on routine exits may need to test the value
which the routine is returning. This value is available as the contents of  the
                                                                             15

global  SIXVREG.  In  general,  the  user  should  never  attempt to access any
registers directly in SIX12 expressions. However, SIXVREG can  be  treated  the
same  as  the  VREG (e.g., it can be modified, and the new value will be in the
VREG when program execution resumes).
16

6. Getting In and Out of SIX12
  By  getting  into  SIX12  we  mean stopping execution of the user program and
causing SIX12 to begin reading and executing user commands.  Getting out is the
reverse process of resuming user execution.

6.1. Getting in

   - One  method  of  entering  SIX12  during  execution  is   through   a
     (previously set) breakpoint; see chapter 5.

   - Another  is  through  a break caused by terminal input monitoring, or
     the MONITOR  (of  data  locations)  operation.    See  Console  Input
     Monitoring (chapter 8) and Monitoring Variables (chapter 9).

   - You  can enter SIX12 before program execution begins (but after stack
     initialization) by entering DDT and setting STARTFLG in SIX1.. to  1.
     Normally  STARTFLG  is set to a true value, so SIX12 will normally be
     entered when execution commences.  However, if it has been set  to  a
     false value (see page 29), it may be set true again by the following:


                         .DEBUG  program files,SIXA12[N110SX12]
                         [LNKXCT DDT Execution]

                         SIX1..$:   STARTFLG!       1 <CR>
                         $G
                         &

     Here  $  =  <escape>, and & is SIX12's prompt for an input.  SIX1..$:
     can be dropped if the name STARTFLG is not used in your program.

   - You can explicitly call SIX12 from your program.  Call  the  external
     name "SIX12" with one parameter, e.g.,


                         EXTERNAL SIX12;

                         .
                         .
                         .
                         SIX12(123);     ! HELP !!

     SIX12 prints the parameter value and stop location:

                         PAUSE n AT location
                         &

   - You can get into SIX12 from DDT by

         JRST SIXDDT$X.

     See Concerning DDT, chapter 7.
                                                                             17

6.2. Getting Out
  Getting out of SIX12 is accomplished by executing one of 3 operators:

GO              resumes user program without any special action.

GOTRACE         turns  on  tracing  before starting. This cancels the effect of
                any active OPAQUE.

RETURN exp      The action of this depends on how you got into SIX12.   If  you
                entered by setting STARTFLAG and having SIX12 recognize this at
                program entry, then the expression is the value of the CCL flag
                (if you compiled the main program with the CCL switch).  If you
                entered  by  an  explicit  call on SIX12, the expression is the
                value of the SIX12(x) expression.  If  you  are  at  a  routine
                exit,  by  either setting an ABREAK (including implicit ABREAKs
                set by STEP and OK), or by MONITOR  detecting  a  change  in  a
                variable or by console polling, then the expression becomes the
                value  returned by the routine.  If you are at a routine entry,
                either by a BREAK (including implicit BREAKs set by STEP) or by
                MONITOR detecting a change of a value or  by  console  polling,
                then  the  execution  of  the  routine  is suppressed.  Control
                returns to its caller with the value exp. Thus RETURN is useful
                for hand-simulating unwritten or malfunctioning code.

STEP            This effectively sets an ABREAK at the current routine,  and  a
                BREAK  at  every  routine  which may be called from the current
                routine, then allows execution to  proceed  much  as  GO  does.
                This  command  allows  you  to single-step through the program.
                Typing <linefeed> will have the same effect.

OK              This effectively sets an ABREAK at  the  current  routine,  and
                then  allows  execution  to  proceed  much  as  GO  does.  This
                command, particularly in conjunction with STEP, allows  you  to
                avoid single-stepping through a routine you know already works.
18

7. Concerning DDT
  We  have  not tried to duplicate the many useful facilities already available
in DDT. Instead, we have implemented easy transfers between SIX12 and DDT.

  You can get into DDT from SIX12 by issuing the command

            DDT

To return to SIX12, type $P to DDT.

  If you are in DDT but you didn't get there from SIX12, you can enter SIX12 by
      9
typing

            JRST SIXDDT$X


Subsequently issuing GO to SIX12 returns you to DDT. (Clearly, you must not  do
this if the stack has been destroyed.)

  A  valid  stack  must be set up before doing the JRST.  This can be set using
the global symbol SIXSP.

    SIXSP/  0       -200,,STACK

will set up a stack of 200 (octal) words at location STACK.

  Once a stack has been set up, SIX12 may be called.  If  SIX12  has  not  been
initialized,  you  must  initialize  it  by  calling one of the routines SIX10,
SIX36C or SIX36, depending upon the version of SIX12 in  use.    If  you  enter
SIX12  by  letting  STARTFLG  have  a "true" value, then SIX12 is automatically
initialized for you.  (It may be necessary to set up a stack even if SIX12  has
been  initialized,  for  example,  if  the  stack  pointer  register  has  been
inadvertently destroyed).










---------------
  9
   Please note that this is different from the  older  sequence  PUSHJ SIXDDT$X
used in versions of SIX12 prior to August, 1979.
                                                                             19

8. Console Input Monitoring
  If  anything is typed when the program is not in a TTY input wait, SIX12 will
shortly fake a  breakpoint  at  some  routine  entry  or  exit,  and  wait  for
completion  of  the  command  (the  input  is taken as the beginning of a debug
expression. Many people cause interrupts by typing  carriage  return,  so  that
they can get a prompt character before doing anything.)  This monitoring is the
normal  state  for  SIX12.  It  can  be disabled, permitting type-ahead, by the
operator

            DISABLE

but will be automatically re-enabled whenever a break occurs  (for  some  other
reason, of course).  If you issue DISABLE and subsequently regret it (e.g., get
caught  in  an  endless loop), you can re-enable monitoring by entering DDT and
setting ENABFLG in SIX1.. to 1; the normal procedure is

            ↑C
            ↑C
            .DDT

            SIX1..$:   ENABFLG!        1 <CR>
            $P
            <CR>
            &

  Here $ = <escape>; & is SIX12's prompt for an input. SIX1..$:  can be omitted
if your program does not use the name ENABFLG.

  To permanently disable polling, the POLLOFF command  can  be  issued.    This
permanent  disabling  can be reset by issuing the POLLON command.  Usually, the
purpose of this is so a system can  be  released  to  users  with  SIX12  still
present (very useful for experimental systems).  The NOPOLLFLG flag can also be
set with DDT, so the typical way of setting a file up for users is


    get MYPROG
    DDT
    NOPOLL/     0      1<cr>
    STARTFL/        -1      0<cr>
    calli 12$X
    EXIT
    SAV (or SSAV, or NSAV or NSSAVE)
    MYPROG saved
20

9. Monitoring Variables
  SIX12  can  keep  track  of  the contents of specified program locations, and
report when they change. The contents of  each  location  being  monitored  are
compared  against  its last reported contents at every routine call and return.
When any changes are found, SIX12 reports them and stops program execution (the
same as a breakpoint). The monitoring message is

            *** Before routine-name                     at an entry
    or      *** During routine-name                     at an exit,

followed by a list of changes found, in the format

            location   Old: oldvalue   New: newvalue

The syntax for requesting monitoring is

            MONITOR  listoflocations

where each location may be a word address or a byte pointer, as in

    MONITOR  ACCUM, BUFHDR<0,18>, FLAGS<30,1>, CHAR, FLAGS<21,1>, 41

The syntax for stopping monitoring is

            DMONITOR listoflocations

  For example, the request shown could lead to a message as follows:

            *** During GETCHR
            CHAR    Old: 122        New: 56
            FLAGS<30,1>     Old: 1  New: 0
            &

where & indicates that SIX12 is waiting for a command. When the user issues GO,
execution will proceed from the exit  of  GETCHR.    Note:  Values  are  always
printed  in the default radix. When a monitoring request is not for a fullword,
the position and size fields are printed in decimal.

  The variables being monitored and their current "old values" can be  examined
using the PRINT MONITOR command; see page 27.
                                                                             21

10. Macros, symbol definition
  As a more or less free spin-off from conditional actions, we have implemented
simple  text  substitution  macros  (no  arguments at present).  The format for
defining a macro is

            MACRO name=|macro text|

where "|" delimits the macro text on both sides (the <escape>  character  could
also  be used, but you can't backspace over it). The macro is invoked merely by
writing its name, as in

            &MACRO CALLR=|R4P(.A, #37)|
            &RESULT = CALLR
            &CALLR
                    5004  BUFFER+345

Macros can be deleted by the operator

            FORGET  list of names

e.g.,

            &FORGET CALLR

Space for the text is not reclaimed. See Disk I/O, chapter 11, for  a  recovery
method  if you run out of text space.  The PRINT MACRO operation can be used to
examine the text of a macro; see the chapter on Display,  chapter  12.    Note:
Macro  names always have precedence over both operators and symbols; but a name
followed by %n is never taken to be a macro.

  New entries can be made in  the  symbol  table;  these  names  will  also  be
available to DDT. The format is



            BIND  name = expression

The name is defined as a global (in module PAT..) with value that of the result
of evaluating the expression. For example,

            &BIND  POINT= @@PNTR
            &POINT
                    1234567 1,,234567
            &DDT

            POINT=1,,234567         $P
            &


The  BIND  operation  should  be used rather than MACRO to define a name with a
constant value, as table lookup is much faster than macro substitution.    BIND
is  a  good  way to create debugging temporaries with user-specified names. For
22

example,

            &BIND MYTEMP = .JOBFF<0,18>; JOBFF = .JOBFF + 1

or

            &BIND DBGCHR= SIXPAT[2]

(as  explained later, SIXPAT[2] names the third of a set of temporary locations
set aside in SIX12 for debugging use.)
                                                                             23

11. Line printer and disk I/O
  Normally,  all  output  from SIX12 is directed to the user's terminal.  Under
certain circumstances (such as  when  tracing,  or  dumping  a  large  area  of
memory),  it  may  be  preferable to save the output on disk, or send it to the
line printer. SIX12 contains a facility for doing this, which is controlled  by
the following operators:

LPTOPEN         opens  a file named SIX12.LPT on logical device LPT: .  It does
                not initiate output to the file. (By assigning the logical name
                LPT: to some other device in advance, the user  can  cause  the
                output to go anywhere.)

LPTON           sets  the  output switch for output to the file. All subsequent
                printout from SIX12 (except error messages) will be directed to
                the file, not printed on the terminal.

LPTOFF          resets the output switch for output to the  terminal.  It  does
                not  close the file, so that more file output may be done later
                in the same file.

LPTDUP          sets the output switch for output to  both  terminal  and  file
                simultaneously.  The worth of this option is doubtful but it is
                included for completeness.

LPTCLOSE        closes the file opened by LPTOPEN. All file output between  one
                pair of LPTOPEN and LPTCLOSE forms a single file, no matter how
                many LPTONs and LPTOFFs have intervened.

  Notes:    An  automatic  LPTOFF  is executed at every break. Thus output will
normally go to the terminal during user interaction.    LPT  I/O  uses  logical
channel #17. Do not use it when your program is using channel #17.
  An  option  is  provided  for  saving  the state of SIX12 on a disk file, and
restoring it at a later session without having to do considerable  type-in,  or
save the whole core image. The operator

            SAVE 'filespec'

saves  all  presently  defined  macros,  requests  for  monitoring, and routine
actions (including conditions) in a disk file specified by filespec,  which  is
input as a string and must be enclosed by single quotes.

            LOAD 'filespec'
            LOAD 'temp:foo'

deletes  any  existing  macros,  monitoring  requests, or routine actions, then
loads the information in the SAVE-written file named by  filespec,  e.g.,  from
file  "foo.612"  on  device  "temp:"  (the  default  extension  is ".612" if an
explicit extension is  not  given.    A  null  extension  may  be  obtained  by
specifying only the "." in the filespec).

   - SAVE  and LOAD use logical channel #16. You can use them in a program
     using that channel just as long as you do not issue  them  when  your
24

     program  has  something open on #16.  The monitor and routine-actions
     tables contain absolute memory addresses.  Thus SAVE/LOAD should  not
     be  used  to  preserve  monitors  or routine actions across a program
     relink.  Use STORE/RECALL for this.  Since  all  previously  existing
     macros  are deleted by LOAD, text space is compacted. The correct way
     to recover from a 'No space for macro text' error is  to  delete  any
     unneeded macros, then

                 &SAVE 'TEMP'
                 &LOAD 'TEMP'

   - The  device  specified (default "DSK:") must be capable of supporting
     36-bit binary I/O.

  In order to save the state across a link,  or  to  have  a  file  of  "stored
commands"  available,  the  commands  STORE and RECALL are available.  They are
exactly like SAVE and LOAD, except the file is an ASCII text file and thus  may
be edited or altered by the user.  RECALL does not clear the SIX12 state before
it is executed, so a user may RECALL several sets of commands in sequence.

  The  default extension, as in SAVE/LOAD, is "612".  Likewise, the I/O is done
using channel #16.  The output device must support ASCII data mode.   Thus,  it
is possible to see all of the SIX12 state in a single command, by typing:

            &STO 'TTY:'

The  file  may  contain line numbers, and if it does they will be stripped off.
If an error occurs, the offending input line will be printed, the error message
will be issued, and input will terminate.
                                                                             25

12. Display
  SIX12  has  facilities  for  printing  some  information in a more meaningful
format than could be  obtained  from  dot  or  slash.  In  particular,  special
operators  are  available  for displaying the run-time stack, the symbol table,
and SIX12's internal tables.

  These operators display the run-time stack in terms of routine calls.

CALLS           displays the complete stack of  routine  calls.  Each  call  is
                displayed in the format

                    routine     from    calling-loc
                         Actuals: values

                The  first line (i.e., the current routine) is prefixed with B:
                if execution stopped at the routine's entry, or A:  if  at  its
                exit, as in

                    A:IMHERE        from CALLER+17
                        Actuals:  1: 5      2: 0
                    CALLER  from    MAIN.F+12
                        Actuals:  1: 45

                which indicates that we are at the exit of 'IMHERE'.

LCALLS          displays  the  call stack plus the locals area for each routine
                (including saved registers and  'displays'  for  functions)  --
                this  may  not  be  very useful to a user not familiar with the
                Bliss runtime environment. Locals are displayed after the  call
                to the routine which owns them.

CALL n          displays  the  last (topmost? innermost?) n calls on the stack.
                If n is omitted (i.e., CALL is used  as  a  nullary  operator),
                only the last call (to the present routine) is printed.

LCALL n         works like CALL but also displays locals.

  Two operators are included for searching the symbol table.

PRS listofsymbols
                (PRint  Symbols)  For each symbol given, PRS prints every entry
                in the symbol table, in the format

                    name%ordinal     value   type    module  contents

                For instance,

                    &PRS  CTYPE,CX
                    CTYPE%1         400360  Own     MAIN..  Routine
                    CTYPE%2*          5601  Own     INPU..  0
                    CX%1            500040  Global  DECL..  Routine w/debug
26

                A  *  next  to  a  name (following the ordinal) means that that
                entry will not be used for typeout by SIX12 or  DDT  (i.e.,  $K
                has  been  performed  on  it).   If the value is a valid memory
                location, and contains what looks like a DEBUG UUO or the first
                instruction of  a  routine  entry  sequence,  then  the  phrase
                "Routine w/debug" or "routine" will be printed out.  Otherwise,
                the octal contents of the location will be printed.

SEARCH 'partially-specified-symbol'
                This  allows  searches  using  the  "wild-card" convention that
                question-mark means any character, as in


                    &SEARCH 'P?C?'
                    PICK            500050  Own     TABL..  Routine
                    PAC               3001  Global  INPU..  17,,INPU.O+27
                    &SEARCH '??????'
                    (prints every entry in symbol table)

                The partially-specified symbol (only one per  search)  must  be
                entered in single quotes. SEARCH does not print ordinals.

  The PRINT operation displays the state of SIX12.

PRINT OPER name

PRINT OPER "char"
                displays  the  definition  (priority  and routine name for each
                defined parse) of the specified operator, as in

                    PRINT OPER "↑"      PRINT OPER AND

                Note: Priorities are displayed in decimal.

PRINT MACRO name
                prints the text of the macro named 'name'. For instance,

                    PRINT MACRO CALLR

                If the macro name is omitted, all  macro  names  and  text  are
                displayed.

PRINT ACTION actionname routine
                prints  the  status  of  the  specified action on the specified
                routine. The action must be given as

                    BREAK ABREAK OPAQ OPAQAFT TRACE TRACEAFT OK ALL

                (remember that TRACE FROM = TRACE +  TRACE AFTER).    The  "OK"
                action  will  indicate  the  (always  unconditional)  temporary
                breakpoint set on a routine from which an OK has been done.  If
                the routine name is omitted, the actions for all  routines  are
                                                                             27

                printed.  The possible responses are

                    'Action not set'
                    'Unconditional'
                    the text of the condition test.

                For example,

                    &PRINT ACTION OPAQ XYZ
                    Action not set
                    &PRINT ACTION ABREAK PPP
                    .X LSS 3

PRINT MONITOR   Prints  the  locations being monitored and the current recorded
                "old value" stored in each.

                            &PRINT MONITOR
                            FOO = 4407 == TEST.O+23
                            BAZ<18,18> = -773465  == 777777,,4313
                            &

                Note that the byte pointer position and size values are printed
                in decimal.

  In addition, the STORE operator (page 24) can be used to print out the entire
set of conditionals, breakpoints, monitors, etc. by doing


            &STO 'tty:'
28

13. Miscellaneous operators

BASE n          sets  the  default  base  to  be  n, and prints the new base in
                decimal. Subsequent input numbers are assumed  to  be  in  this
                base,  and  output  will  appear in this base (except for items
                specified to appear in decimal).  If n  is  omitted  BASE  only
                prints  the  current  base.  The initial default base is 8 (for
                octal).  The special case of BASE 0  resets  the  base  to  the
                initial base (octal), no matter what it was set to.

WBASE n         sets  the  maximum  displacement  to  be  allowed when printing
                symbolic addresses in the form 'symbol+offset'.  This works  in
                                                 10
                exactly  the  same  way  as  n$UW   in CMU-DDT, or the value in
                location $M+1 in DEC DDT.  WBASE functions in the same  way  as
                BASE  except  that  the value is printed in the current default
                base. The WBASE is initialized to 1000 octal.
SETTRACE        Turns on the trace flag. When execution  resumes  tracing  will
                begin  immediately.  This  cancels  the  effects  of any active
                OPAQUE. The GOTRACE operator described earlier is equivalent to


                    SETTRACE ; GO

CLRTRACE        Turns off the trace flag. This cancels the effects of an active
                TRACE AFTER or a previous SETTRACE.

NODEBUG         This performs

                    JOB41 = #255000000000           (JFCL 0,0)
                    GO

                Thus, the DEBUG UUO is rendered a no-op. This can  be  used  to
                improve  execution  time  if  you  are  only  running a program
                without intending to debug it.

RESET           Performs a RESET (UUO or JSYS).  All currently opened files are
                aborted, and various appropriate resetting of the job state  is
                done  by  the monitor.  Note that neither SIX12 nor the program
                are reset or restarted by this command.
IDENT           Prints out the version of SIX12, the version  of  Bliss  it  is
                expecting (Bliss-10 or Bliss-36) and the runtime environment it
                is expecting (TOPS-10 or TOPS-20).

!               An exclamation point at the start of a line indicates a comment
                and the remainder of the line is ignored.

---------------
  10
    W is for Wulf for historical reasons.
                                                                             29

14. Using SIX12

14.1. General usage
  The modules to be debugged must be compiled as follows:

   - Each  module  to  be  debugged must be compiled with the DEBUG switch
     set. This can be accomplished by  including  "DEBUG"  in  the  module
     head, or by specifying "/D" in the compiler command string.

   - The  main  module  (the  one  including the STACK specification) must
     include "TIMER=EXTERNAL(SIX12)" in  its  module  head.  (At  present,
     timing and debugging cannot be specified simultaneously.)

   - We  do  not suggest the use of DEC Bliss-10 less than release level 7
     as it does not  always  generate  the  necessary  linkages.  Use  CMU
     Bliss-10 or DEC Bliss-10 at level 7 or higher only.

  Once you have compiled all your files, load them with the appropriate version
of SIX12 and DDT; be sure that local symbols are loaded for your program files.
There  are  several  version  of SIX12, depending on the version of Bliss being
used, the linkage conventions, and the underlying operating system.

    Version         O/S     Language

    SIXA12.REL      TOPS-10 Bliss-10, using default register assignments.
                            Bliss-36C, using BLISS10←REGS module switch
                            Bliss-36, using Bliss-10 linkages

    SIXB12.REL      TOPS-10 Bliss-10, using /Z register assignments
                            Bliss-36C, using default register assignments
                            Bliss-36, using default linkage

              11
    SIXD12.REL   TOPS-20 Bliss-10, using /Z register assignments
                            Bliss-36C, using default register assignments
                            Bliss-36, using default linkage

    SIXF12.REL      TOPS-10 SIXA12 with LG support package (CMU)

    SIXG12.REL      TOPS-10 SIXB12 with LG support package (CMU)

  Using either the TOPS-10 or TOPS-20 linker, options may be selected  at  link
time  for  SIX12  switches  STARTFLG,  ENABFLG  and NOPOLLFLG.  The LINK switch
/DEFINE: can be used to define initial values for these switches:

---------------
  11
    TOPS-10 versions can be used on TOPS-20 with the compatibility package.
TOPS-20 versions use JSYS exclusively.
30

                    Initial Value
    Switch          LINK name       Default value   Complement
    STARTFLG        SIXSTF          -1              /DEFINE:SIXSTF:0
    ENABFLG         SIXENF          -1              /DEFINE:SIXENF:0
    NOPOLLFLG       SIXPOL          0               /DEFINE:SIXPOL:-1

  These values may also be set at execution time using DDT or SIX12 itself; for
example,  STARTFLG  may be defined false (/DEFINE:SIXSTF:0) but set true before
execution begins by using DDT.  This is shown on page 16.    Such  redefinition
will  cause  the  linker  to issue a "multiply defined symbol" warning when the
definition in the SIX12 module is  encountered,  but  this  message  should  be
ignored.

14.2. TOPS-10 usage
  The easy way to load SIX12 is with the monitor DEBUG command:
                                                       12
            .DEBUG  your program files,SIXA12[N110SX12]

If you prefer to use LINK directly, you can issue

            .R LINK
            */DEBUG  your program files,SIXA12[N110SX12]
            */GO

Usually,  SIX12  should  be  loaded  last  so  that its program symbols will be
scanned last in a symbol table  search.  To  reduce  the  chance  of  confusion
further, you can load SIX12 without its local symbols, as in

            .DEBUG  your program files,SIXA12[N110SX12]%W

(All  global symbols in SIX12 begin with the letters S I X. The only non-global
symbols that you are likely to need are STARTFLG, ENABFLG and NOPOLLFLG,  which
can be accessed as SIX1.O, SIX1.O+1 and SIX1.O+2, respectively.)
  The  debugging  linkages generated by the DEBUG switch use the #037 user UUO.
If your program does not use user UUOs (opcodes #001-#037), you  can  skip  the
following. If you do use UUOs, you must

   - not use opcode #037,

   - arrange  for  your  UUO  handler  to link to SIX12 properly.  This is
     merely a matter of getting the proper jump address  for  SIX12's  UUO
     entry point. Because the entry point is not a global symbol, you must
     retrieve  the jump address from location .JB41 before loading it with
     a branch to your own handler. (SIX12 loads  .JB41  with  a  PUSHJ  to
     itself    immediately   after   stack   initialization.)   Your   UUO

---------------
  12
    Or SIXB12, if you are using Bliss-36.
                                                                             31

     initialization code would look something like this (in Bliss-10):

         Global UUOROUTS[#40];
         External UUOSwitch, ?.JB41;
                 .
                 .
         UUOROUTS[#037] = .?.JB41<0,18>; ! *** DEBUG ONLY ***
         ! Put  PUSHJ SREG,UUOSWITCH  into loc. 41
         ?.JB41 = #260↑27 or SREG<0,0>↑23 or UUOSwitch<0,0>;

     where the routine

                 Machop  JRST = #254;
                 Global Routine UUOswitch =
                         JRST(0,UUOROUTS[ .JOB41<27,9> ],0,1);

     must be in a separate module which is compiled without FSAVE, TIMING,
     or DEBUG switches (/F, /T, or /D).
32

15. Defining your own operators
  As  previously advertised, SIX12 is capable of easy extension. The method for
this is normally to define new operators or revise standard ones to  suit  your
needs.   (Please review what we said about operators under 'SIX12 expressions',
if it is not fresh in your mind.)

  The syntax (print name, priority, possible parses) of an operator is  defined
by  an entry in a syntax analyzer table. Its semantics are defined by a routine
which the table entry points to. To evaluate the operator, the  analyzer  calls
this  routine  using a standard linkage convention. The content of this section
is a description of 1) the linkage convention and  2)  the  proper  method  for
making entries in the syntax table.

  Linkage:  Since  operands  and  values  can be vectors, it is not possible to
transfer them by standard Bliss linkage. Instead, variables are set to point to
an operand and give its length. The variables are:

SIXLP           contains a pointer to the  first  word  of  the  left  operand.
                (Undefined if no left operand.)

SIXLC           contains  the number of words in the left operand.  (Zero if no
                left operand.)

SIXRP           Like SIXLP, except contains corresponding values for the  right
                operand.

SIXRC           contains  the  number of words in the right operand (zero if no
                right operand).

These variables are set at the routine call; the routine may destroy them if it
wishes. (The contents of the operands may also be  destroyed.)    To  return  a
value, the routine should set these two variables:

SIXVP           must  contain the address of the first word of the value.  (The
                left half of SIXVP is ignored.)

SIXVC           must contain the number of words in the value.

If no value is to be returned these can be left unmodified. (The criterion  for
finding a value is that SIXVC be positive; it is set to zero before calling the
routine.)  Note  that  operands and values are always vectors of fullwords.  An
evaluating routine may need to determine what parse it has been  called  under.
The  parse  in use can always be determined by examining SIXLC and SIXRC, but a
more convenient way is provided. Evaluating routines are called with  a  single
parameter (standard Bliss linkage), which has the value

            0       for null parse (no operands)
            1       for prefix parse (a right operand only)
            2       for postfix parse (a left operand only)
            3       for infix parse (both operands);

thus  bit  0  denotes  the presence of a right operand and bit 1 that of a left
                                                                             33

operand.  We suggest examining the source of SIX12 to see the best ways to code
operators.  The  macro APPLY and the routines XBASE and LPAREN are particularly
good objects of study.  The table: For  each  operator  symbol,  the  table  of
operators  contains  the symbol itself (print name), and information on each of
the four possible parses for the  symbol.  This  information  consists  of  the
priority of operation and the address of the evaluating routine for that parse.
(If  both  are  zero,  the parse does not apply.)  Priorities are in increasing
sequence, that is an operator  of  priority  15  is  evaluated  before  one  of
priority 14. If the user is making a permanent modification to SIX12, he should
modify  the  table  in  the  source  program; this is explained by notes in the
source. Otherwise, in order to avoid recompiling SIX12, the user can create his
new routines separately, compile them  (without  /D,  of  course!),  load  them
together  with  SIX12  and  the program to be debugged, and modify the operator
table at  run-time.    To  facilitate  this  approach,  the  linkage  variables
explained above are all global names, and an operator is provided for modifying
the table at run-time.

            DEFINE name,parse = priority,routine
    or      DEFINE "char",parse = priority,routine

sets the parse information as requested. "Parse" can be one of

                   NULL           PREFIX         POSTFIX        INFIX

or 0 - 3. Note that only the specified parse is affected; the others remain set
as  before.  (If  a  new  operator  symbol  is  being  defined, the other 3 are
initialized to zero, i.e. "parse not applicable".)  For example,

            DEFINE SIXBIT,PREFIX = 100,CONVRT

where CONVRT names a routine to translate ASCII inputs to SIXBIT outputs, could
be used to implement the SIXBIT stringtype. Once this  has  been  entered,  the
user could issue

            & FILNAM = SIXBIT 'ABCDEF'

Again,

            DEFINE "?",0 = 10,DISPLAY

would  make  it possible to call the routine DISPLAY by typing a question mark.
(If no value were required from "?" and DISPLAY  expected  no  arguments,  this
could  be  done  even  if  DISPLAY  had  not been written explicitly as a SIX12
operator...) Thus

            & ?
            (output from DISPLAY)
            &

The PRINT OPER operation can be used to verify the effects of DEFINE.  Remember
that priorities are printed in decimal by PRINT OPER.
34

16. SIX12S
  A  smaller  version and older version, SIX12S, exists for those who find that
standard SIX12 is too large and/or too slow.  SIX12S has no macros, conditional
actions, or SAVE/LOAD facility.  It also  does  not  incorporate  most  of  the
user-convenience  features of SIX12.  SIX12S is no longer maintained at CMU, so
whatever state it was in some years ago is where it will remain.

  SIX12S features faster breakpoint checking, and  much  less  code  and  table
space inside SIX12.  The operators not defined in SIX12S are

    MACRO           PRINT MACRO             FORGET
                    PRINT ACTION            PRINT ALL
    IF  |test|  action  rtn-list
    SAVE            LOAD
    GEQ through LSS
    IDENT
    COPAQUE         NOCOPAQUE
    STEP            <lf>            OK
    POLLON          POLLOFF

  To   use   this   version   (at   CMU),   access  SIX12S.BLI,  SIX12S.REL  on
DSKB:[L130BL98] (it will not be put on SYS: at CMU).
                                                                             35

17. Operation summary

#               Change input radix; see page 5.

%               Disambiguate  identifier  name;  see  page  6.   Also indicates
                access to routine actions or routine locals; see page 10.

()              Grouping or routine call; see page 8.

*               Multiply; see page 8.

/               Infix Divide; see page 8; postfix examine; see page 11.

+               Add; see page 8.

-               Unary minus or subtract; see page 8.

.               Contents of; see page 8.

@               Contents of; see page 9.

<>              Byte pointer; see page 8.

[]              Structure access; see page 9.

↑               Shift operator; see page 8.

=               Assignment; see page 8.

|               Delimiter for conditional text or macro text; see page 12.

ABREAK          Set a breakpoint after a routine.  See page 13.

AND             Bitwise AND.

BASE            Set the input and output radix.  See page 28.

BIND            Create a symbol and assign a value to it.  See page 21.

BREAK           Set a breakpoint at a routine entry.  See page 13.

CALL            Print out a number of calls on the call stack.  See page 25.

CALLS           Print out the entire call stack.  See page 25.

CLRTRACE        Turn off global trace flag.  See page 28.

DABREAK         Remove an ABREAK; see page 13.

DBREAK          Remove a BREAK; see page 13.

DDT             Enter DDT; see page 18.
36

DEFINE          Define  a  new  SIX12  operator  and  associate  it with a user
                routine.  See page 33.
DISABLE         Disable console polling until the next SIX12 entry.   See  page
                19, also see POLLOFF, page 19.

DMONITOR        Disable MONITOR of a location; see page 20.

DOPAQUE         Remove OPAQUEs from routines; see page 14.

DOPAQUE AFTER   Remove OPAQUE AFTERs from routines; see page 14.

DTRACE          Remove TRACEs from routines; see page 13.

DTRACE AFTER    Remove TRACE AFTERs from routines; see page 14.

DTRACEFROM      Remove TRACE FROMs from routines; see page 14.

EQL             bitwise equality.

FORGET          Delete a MACRO definition; see page 21.

GEQ             Signed greater than or equal.

GO              Resume execution.  See page 17.

GOTRACE         SETTRACE; GO.  See page 17.

GTR             Signed greater-than.

IDENT           Prints  out  SIX12 version, Bliss version, and operating system
                I/O expected.  See page 28.
IF              Noise word used in specifying conditionals for breakpoints; see
                page 12.
LCALLS          Print out all calls, plus local variables.  See page 25.

LEQ             Signed less than or equal.

<linefeed>      Same as STEP.  See page 17.

LOAD            Load binary state from a file.  See page 23.

LPTCLOSE        Close line printer output file.  See page 23.

LPTDUP          Enable output to both line printer and terminal.  See page 23.

LPTOFF          Disable output to line printer.  See page 23.

LPTON           Enable output to line printer.  See page 23.

LPTOPEN         Create line printer  output  file;  required  before  LPTON  or
                LPTDUP can be done.  See page 23.
                                                                             37

LSS             Signed less-than.

MACRO           Define a parameterless macro.  See page 21.

MONITOR         Monitor a location and report changes.  See page 20.

NEQ             Inequality operator.

NODEBUG         Permanently disable debugging.  See page 28.

NOT             Bitwise complement.

OK              Execute the current routine and ABREAK after it.  See page 17.

OPAQUE          Disable  tracing  at  this  point;  the  routine  itself is not
                traced.  See page 14.

OPAQUE AFTER    Disable tracing after this routine.    The  routine  itself  is
                traced.  See page 14.

OR              Bitwise inclusive-or.

POLLOFF         Permanently  DISABLE  console  polling.  See also DISABLE.  See
                page 19.

POLLON          Enable console polling.  See page 19.

PRINT ACTION    Print the conditional action set for a routine.  See page 26.

PRINT MACRO     Print the text of a macro.  See page 26.

PRINT MONITOR   Prints the locations being monitored, and the current  recorded
                "old value" for each location.  See page 27.

PRINT OPER      Print the definition of an operator.  See page 26.

PRS             Print  out symbol table information for a specific symbol.  See
                page 25.

RECALL          Loads a set of SIX12 commands from a text file.  This text file
                may have been created by the STORE command.  See also the  LOAD
                command.  See page 24.

RESET           Issue  a  TOPS-10 RESET UUO or the TOPS-20 JSYS #147.  See page
                28.

RETURN          Return from the current routine and  provide  a  value  to  the
                caller.  See page 17.

SAVE            Save  the  binary representation of breakpoints, monitors, etc.
                See also the STORE command.  See page 23.
38

SEARCH          Search  DDT symbol table for partially-specified name; see page
                26.

SETTRACE        Set the global trace-flag.  See page 28.

STEP            Single step program from one SIX12 event to another.  See  page
                17.

STORE           Saves the current values for breakpoints, monitors, etc.  as an
                ASCII text file.  See also SAVE.  See page 24.

TRACE           Set tracing on a particular routine.  See page 13.

TRACE AFTER     Enable  global  tracing  after entry to the named routine.  See
                page 13.

TRACE FROM      Enable tracing upon entry to the named routine.  See page 13.

WBASE           Set the offset used for printing symbolic addresses;  see  page
                28.
                                                                             39

18. Global Entry Points and Data Areas

SIX10           Initialization entry used for Bliss-10.

SIX12           User  callable  entry  point to explicitly invoke SIX12; called
                with one parameter.  See page 16.

SIX36C          Initialization entry used for Bliss-36C.

SIX36           Initialization entry used for Bliss-36; currently unused, since
                Bliss-36 and Bliss-36C linkages identical.

SIXDDT          Jump address to start SIX12 from  DDT  using  JRST SIXDDT$X.  A
                valid  stack  pointer (register SIXSP) must be set up first, if
                necessary.   If  SIX12  has  not  been  initialized,  then  use
                PUSHJ SIXSP,SIXxxx$X  instead,  where SIXxxx is SIX10, SIX36 or
                SIX36C.  GO from SIX12 will return to DDT.

SIXENF          Initial value of ENABFLG.  May be  redefined  using  LINK,  see
                page 29.

SIXOSA          Routine  entry  point  to print an ASCIZ string on the terminal
                using the SIX12 internal routine for this purpose.  Called with
                one parameter, the address of the beginning of the string.

SIXPAT          Twenty word patch area.  BIND may be used to establish symbolic
                names for variables the user sets in this area, e.g.


                    &BIND CHECKIT = SIXPAT[4]
                    &if |.CHECKIT| BREAK someroutine
                    &CHECKIT = 1

SIXPOL          Initial value of NOPOLLFLG.  May be redefined using LINK.   See
                page 29.
SIXRET          Instruction to return to SIX12 using SIXRET$X (does not work in
                CMU DDT).  Equivalent to JRST @.JBOPC or $P.

SIXSP           Stack register name (suppressed for typeout).

SIXSTF          Initial  value  of STARTFLG.  May be redefined using LINK.  See
                page 29.
SIXSTK          Contains the value of the stack pointer register when SIX12  is
                initialized.

SIXUUO          Address of SIX12 handler for DEBUG UUO.
40

Index

          !, comment   28
          !, infix   11
          #   5, 10
          %   6
          %, in names   10
          %0, in names   10
          %A, Actual Parameter   10
          %L, Local variable   10
          &, in names   10
          &, prompt   11
          ()   8
          *   8
          +   8
          -   8
          .   8
          ., in names   10
          .612, extension   23
          .JB41   30
          /   8, 11
          /D   29
          /DEFINE, LINK switch   29
          <>   8
          =   6, 8
          ?, in names   10
          @   9
          []   9
          ↑   8
          ←, in names   10
          |   12, 21

          %A, Actual Parameters   10
          A:, prefix on typeout   25
          ABREAK   13
          Actual Parameters, accessing   10
          AND   8

          B:, prefix on typeout   25
          BASE   5, 28
          BIND   21
          BLOCK structure   9
          BREAK   13
          Breakpoints   12
          Byte pointers   8

          CALL   25
          CALLS   25
          Changing locations   11
          CLRTRACE   28
          Comment   28
          Conditional breakpoints   12
                                                                             41

          Console polling   19
          COPAQUE   14

          /D   29
          DABREAK   13
          DBREAK   13
          DDT   18
          DEBUG   29
          DEFINE   33
          /DEFINE, LINK switch   29
          DISABLE   19
          Displaying locations   11
          DMONITOR   20
          DOPAQUE   14
          DOPAQUE AFTER   14
          DTRACE   13
          DTRACE AFTER   14
          DTRACE FROM   14

          ENABFLG   19, 30, 39
          ENABFLG, defining at link time   29
          EQL   8
          Escape convention   10
          Extension .612   23

          FORGET   21

          GEQ   8
          GO   17
          GOTRACE   17
          GTR   8

          IDENT   28
          IF   12
          INFIX   33

          .JB41   30

          %L, Local variables   10
          LCALLS   25
          LEQ   8
          Line Printer Output   23
          Linefeed   17
          LOAD   23
          Local variables, accessing   10
          LPTCLOSE   23
          LPTDUP   23
          LPTOFF   23
          LPTON   23
          LPTOPEN   23
          LSS   8

42

          MACRO   21
          MONITOR   20

          Name%0   10
          Name%n   10
          Names, syntax   10
          NEQ   8
          NOCOPAQUE   14
          NODEBUG   28
          NOPOLLFLG   19, 30, 39
          NOPOLLFLG, defining at link time   29
          NOT   8
          NULL   33
          Number%A   10
          Number%L   10

          OK   17
          OPAQUE   14
          OPAQUE AFTER   14
          Operators, defining   32
          OR   8

          POLLOFF   19
          POLLON   19
          POSTFIX   33
          PREFIX   33
          PRINT ACTION   26
          PRINT MACRO   21, 26
          PRINT MONITOR   27
          PRINT OPER   26, 33
          PRS   25

          Quoted strings   5

          Radix of numbers   5
          RECALL   24
          REF-structure   9
          RESET   28
          RETURN   17
          Routine calls   8

          SAVE   23
          SEARCH   26
          SETTRACE   28
          Shift   8
          SIX1..   19
          SIX10, routine   39
          SIX12   16
          .612, extension   23
          SIX12, routine   39
          SIX12S   34
          SIX36, routine   39
                                                                             43

          SIX36C, routine   39
          SIXDDT   16, 18
          SIXDDT, address   39
          SIXENF   39
          SIXENF, ENABFLG LINK symbol   29
          SIXLC   32
          SIXLP   32
          SIXOSA   39
          SIXPAT   39
          SIXPOL   39
          SIXPOL, NOPOLLFLG LINK symbol   29
          SIXRC   32
          SIXREF   9
          SIXRET   39
          SIXRP   32
          SIXSP   18, 39
          SIXSTF   39
          SIXSTF, STARTFLG LINK symbol   29
          SIXSTK   39
          SIXUUO   39
          SIXVC   32
          SIXVP   32
          SIXVREG   13, 14
          STARTFLG   16, 30, 39
          STARTFLG, defining at link time   29
          STEP   17
          STORE   24
          Structure access   9
          Structure BLOCK   9
          Structure VECTOR   9
          Structure, REF-   9
          Symbol table, printing   25
          Symbol table, searching   26

          TIMER=EXTERNAL(SIX12)   29
          TRACE   13
          TRACE AFTER   13
          TRACE FROM   13
          Tracing   12

          User UUOs   30
          UUO Handler   30

          VECTOR structure   9

          WBASE   28
                                                                              i

                               Table of Contents

1. Introduction                                                               1

1.1. The August 1979 Version                                                  1
1.2. SIX12 overview                                                           1
1.3. Advantages of SIX12 over DDT                                             2
1.4. Disadvantages of SIX12                                                   3

2. SIX12 expressions                                                          5

3. Basic Bliss                                                                8

3.1. Structure accesses                                                       9
3.2. Numbers, names and strings                                              10

4. Peeking and Poking                                                        11

5. Breakpointing, Tracing                                                    12

6. Getting In and Out of SIX12                                               16

6.1. Getting in                                                              16
6.2. Getting Out                                                             17

7. Concerning DDT                                                            18

8. Console Input Monitoring                                                  19

9. Monitoring Variables                                                      20

10. Macros, symbol definition                                                21

11. Line printer and disk I/O                                                23

12. Display                                                                  25

13. Miscellaneous operators                                                  28

14. Using SIX12                                                              29

14.1. General usage                                                          29
14.2. TOPS-10 usage                                                          30

15. Defining your own operators                                              32

16. SIX12S                                                                   34
ii

17. Operation summary                                                        35

18. Global Entry Points and Data Areas                                       39

Index                                                                        40